package com.gxa.dao;

import com.gxa.dto.CommunityDto;
import com.gxa.entity.Community;
import com.gxa.entity.extend.QueryAllCommunity;
import com.gxa.vo.CommunityVo;

import java.sql.SQLException;
import java.util.List;

public interface CommunityDao {
    List<QueryAllCommunity> queryCommunity() throws SQLException;
    List<QueryAllCommunity> queryCommunity(Integer page,Integer limit) throws SQLException;
    List<QueryAllCommunity> queryCommunity(Integer page, Integer limit, CommunityDto communityDto) throws SQLException;
    Integer count() throws SQLException;
    Integer count(CommunityDto communityDto) throws SQLException;
    //添加
    void add(Community community) throws SQLException;
    //根据小区id查询
    Community queryByID(Integer cid) throws SQLException;
    //修改小区
    void update(Community community) throws SQLException;

    //根据小区id删除
    void delete(Integer cid) throws SQLException;

    /**
     * 查询所有的小区
     * @return
     */
    List<Community> selectAlLCommunity() throws SQLException;

    // 修改小区的备注
    int updateRemarkInCommunity(Community community);

    /**
     * 带参数分页查询所有的小区
     * @param page 页数
     * @param limit 每页数量
     * @param communityDto
     * @return
     */
    List<CommunityVo> selectAlLCommunityByPageAndDto(int page, int limit, CommunityDto communityDto);
}
